package Creational_design_pattern.Simple_Factory;

public class SimpleCoffeeFactory {
    public static Coffee createCoffee(String Type) {
        Coffee coffee = null;
        if("Americano".equals(Type)){
            coffee = new Americano();
        }
        else if("Latte".equals(Type)){
            coffee = new Latte();
        }
        else {
            throw new RuntimeException("Sorry Coffee Not Found");
        }
        return coffee;
    }
}
